<template>
  <div>
    <div
      class="
        aisle-template
        haruyuki-flex-space-between haruyuki-align-items-center haruyuki-mb-20
      "
    >
      <div>
        <span class="haruyuki-size-18">通道模板：</span>
        <el-select
          size="small"
          v-model="policyTemplateCode"
          @change="templateAllChange"
          @clear="templateAllClear"
          placeholder="可选择一键分配模板"
          clearable
        >
          <el-option
            v-for="item in policyTemplate"
            :key="item.polNo"
            :label="item.polName"
            :value="item.polNo"
          >
          </el-option>
        </el-select>
      </div>
      <div class="haruyuki-flex-center">
        <div class="haruyuki-mr-20">
          <span>结算底价：</span>
          <el-input-number
            size="mini"
            v-model="aptTemplate.aptRate"
            :precision="4"
            :step="0.0001"
            :min="0"
            :max="1"
          ></el-input-number>
          <span> %</span>
        </div>
        <div class="haruyuki-mr-20">
          <span>结算比例：</span>
          <el-input-number
            size="mini"
            v-model="aptTemplate.aptScale"
            :precision="0"
            :min="1"
            :max="100"
          ></el-input-number>
          <span> %</span>
        </div>
        <div class="haruyuki-mr-20">
          <span>垫资费率：</span>
          <el-input-number
            size="mini"
            v-model="aptTemplate.codeAdvanceRate"
            :precision="4"
            :step="0.0001"
            :min="0"
            :max="1"
          ></el-input-number>
          <span> %</span>
        </div>
      </div>
      <el-button type="primary" size="small" plain @click="submitCover">一键填入</el-button>
    </div>
    <div class="haruyuki-scrollbar-60vh haruyuki-p-10">
      <div
        class="aisle-policy-box haruyuki-mb-20"
        v-for="(dataItem, index) in data"
        :key="index"
      >
        <div
          class="
            aisle-template
            haruyuki-flex-space-between haruyuki-align-items-center
            aisle-policy-bg
          "
        >
          <div class="haruyuki-flex-center">
            <span
              class="haruyuki-size-16 policy-ml-3 policy-mr-6"
              @click="dataItem.isShow = !dataItem.isShow"
            >
              <i
                :class="
                  dataItem.isShow
                    ? 'el-icon-caret-bottom'
                    : 'el-icon-caret-right'
                "
              ></i
              > {{ dataItem.aisleName }}<span class="haruyuki-color-subjectblue policy-fs-14" v-if="dataItem.isDefault == 1">（默认通道）</span></span
            >
            <el-select
              size="mini"
              v-model="dataItem.templatePolNo"
              @change="templateChildChange($event, index)"
              @clear="templateChildClear(index)"
              placeholder="可对通道选择单独模板"
              clearable
            >
              <el-option
                v-for="templateItem in dataItem.template"
                :key="templateItem.polNo"
                :label="templateItem.polName"
                :value="templateItem.polNo"
              >
              </el-option>
            </el-select>
          </div>
          <div
            class="policy-ml-3 policy-mr-6"
            v-if="dataItem.isDefault == 0"
          >
            <el-button
              type="text"
              size="mini"
              @click.stop="() => handleSwitch(index)"
            >
              设为默认
            </el-button>
          </div>
        </div>
        <div v-show="dataItem.isShow">
          <div class="haruyuki-line-height-special haruyuki-plr-40">
            <span>服务商结算底价：</span>
            <el-input-number
              size="mini"
              v-model="dataItem.aptRate"
              :precision="4"
              :step="0.0001"
              :min="0"
              :max="1"
            ></el-input-number>
            <span> %</span>
          </div>
          <div class="haruyuki-line-height-special haruyuki-plr-40">
            <span>服务商结算比例：</span>
            <el-input-number
              size="mini"
              v-model="dataItem.aptScale"
              :precision="0"
              :min="1"
              :max="100"
            ></el-input-number>
            <span> %</span>
          </div>
          <div class="haruyuki-line-height-special haruyuki-plr-40">
            <span>服务商垫资费率：</span>
            <el-input-number
              size="mini"
              v-model="dataItem.codeAdvanceRate"
              :precision="4"
              :step="0.0001"
              :min="0"
              :max="1"
              @change=changeCodeAdvanceRate(dataItem)
            ></el-input-number>
            <span> %</span>
          </div>

          <div v-if="dataItem.isShowUnionPay == 1">
            <div v-if="dataItem.serviceForm">
              <div class="haruyuki-line-height-special haruyuki-plr-40" @click="dataItem.serviceForm.isShow = !dataItem.serviceForm.isShow " >
                <i :class="dataItem.serviceForm.isShow ? 'el-icon-caret-bottom' : 'el-icon-caret-right'"></i>
                <span>服务商-云闪付(结算成本)：</span>
              </div>
              <div v-show="dataItem.serviceForm.isShow">
                <div class="haruyuki-line-height-special haruyuki-plr-80">
                  <span>借记卡（≥1000）成本费率（比例）：</span>
                  <el-input-number
                    size="mini"
                    v-model="dataItem.serviceForm.debitRate"
                    :precision="4"
                    :step="0.0001"
                    :min="0"
                    :max="1"
                  ></el-input-number>
                  <span> %</span>
                </div>
                <div class="haruyuki-line-height-special haruyuki-plr-80">
                  <span>贷记卡（≥1000）成本费率（比例）：</span>
                  <el-input-number
                    size="mini"
                    v-model="dataItem.serviceForm.creditRate"
                    :precision="4"
                    :step="0.0001"
                    :min="0"
                    :max="1"
                  ></el-input-number>
                  <span> %</span>
                </div>
                <div class="haruyuki-line-height-special haruyuki-plr-80">
                  <span>借记卡大额封顶金额（笔）：</span>
                  <el-input-number
                    size="mini"
                    v-model="dataItem.serviceForm.debitGtMax"
                    :precision="2"
                    :step="0.1"
                    :min="0"
                  ></el-input-number>
                  <span> ¥</span>
                </div>
                <div class="haruyuki-line-height-special haruyuki-plr-80">
                  <span>借记卡小额封顶金额（笔）：</span>
                  <el-input-number
                    size="mini"
                    v-model="dataItem.serviceForm.debitLtMax"
                    :precision="2"
                    :step="0.1"
                    :min="0"
                  ></el-input-number>
                  <span> ¥</span>
                </div>
                <!-- <div class="haruyuki-line-height-special haruyuki-plr-80 haruyuki-flex-space-between">
                  <div>
                    <span>借记卡成本费率(大于1000)：</span>
                    <el-input-number
                      size="mini"
                      v-model="dataItem.serviceForm.debitRate"
                      :precision="4"
                      :step="0.0001"
                      :min="0"
                      :max="1"
                    ></el-input-number>
                    <span> %</span>
                  </div>
                  <div>
                    <span>贷记卡成本费率(大于1000)：</span>
                    <el-input-number
                      size="mini"
                      v-model="dataItem.serviceForm.creditRate"
                      :precision="4"
                      :step="0.0001"
                      :min="0"
                      :max="1"
                    ></el-input-number>
                    <span> %</span>
                  </div>
                </div> -->
              </div>
            </div>
            
            <!-- START 刷卡 -->
            <div
              class="haruyuki-line-height-special haruyuki-plr-40"
              @click.stop="dataItem.posTrad.isShow = !dataItem.posTrad.isShow"
              v-if="dataItem.isHasPos === 1"
            >
              <i
                :class="
                  dataItem.posTrad.isShow
                    ? 'el-icon-caret-bottom'
                    : 'el-icon-caret-right'
                "
              ></i>
              <span>服务商-刷卡(结算价)：</span>
            </div>
            <div
              v-show="dataItem.posTrad.isShow"
            >
              <div class="haruyuki-line-height-special haruyuki-plr-80">
                <span>垫资费率（比例）：</span>
                <el-input-number
                  size="mini"
                  v-model="dataItem.posTrad.codeAdvanceRate"
                  :precision="4"
                  :step="0.0001"
                  :max="1"
                ></el-input-number>
                <span> %</span>
              </div>
              <div class="haruyuki-line-height-special haruyuki-plr-80">
                <span>贷记卡刷卡结算底价（比例）：</span>
                <el-input-number
                  size="mini"
                  v-model="dataItem.posTrad.creditRate"
                  :precision="4"
                  :step="0.0001"
                  :max="1"
                ></el-input-number>
                <span> %</span>
              </div>
              <div class="haruyuki-line-height-special haruyuki-plr-80">
                <span>借记卡刷卡结算底价（比例）：</span>
                <el-input-number
                  size="mini"
                  v-model="dataItem.posTrad.debtRate"
                  :precision="4"
                  :step="0.0001"
                  :max="1"
                ></el-input-number>
                <span> %</span>
              </div>
              <div class="haruyuki-line-height-special haruyuki-plr-80">
                <span>借记卡刷卡封顶金额（笔）：</span>
                <el-input-number
                  size="mini"
                  v-model="dataItem.posTrad.debtRateMax"
                  :precision="2"
                  :step="0.1"
                ></el-input-number>
                <span> ¥</span>
              </div>
              <div class="haruyuki-line-height-special haruyuki-plr-80">
                <span>挥卡小额（{{ thousandMin }}）结算底价（比例）：</span>
                <el-input-number
                  size="mini"
                  v-model="dataItem.posTrad.waveRate"
                  :precision="2"
                  :step="0.1"
                  :max="1"
                ></el-input-number>
                <span> %</span>
              </div>
              <div class="haruyuki-line-height-special haruyuki-plr-80" v-if="dataItem.posTrad.isShowVip == 1">
                <span>银联费率（比例）：</span>
                <el-input-number
                  size="mini"
                  v-model="dataItem.posTrad.unionpayRate"
                  :precision="4"
                  :step="0.0001"
                  :max="1"
                ></el-input-number>
                <span> %</span>
              </div>
              <div class="haruyuki-line-height-special haruyuki-plr-80" v-if="dataItem.posTrad.isShowVip == 1">
                <span>尊享费率（比例）：</span>
                <el-input-number
                  size="mini"
                  v-model="dataItem.posTrad.vipRate"
                  :precision="4"
                  :step="0.0001"
                  :max="1"
                ></el-input-number>
                <span> %</span>
              </div>
            </div>
            <!-- END 刷卡 -->

            <!--START 商户-(签约费率) -->
            <div v-if="dataItem.merchantForm">
              <div class="haruyuki-line-height-special haruyuki-plr-40" @click="dataItem.merchantForm.isShow = !dataItem.merchantForm.isShow" >
                <i :class="dataItem.merchantForm.isShow ? 'el-icon-caret-bottom' : 'el-icon-caret-right'"></i>
                <span>商户-(签约费率)：</span>
              </div>
              <div v-show="dataItem.merchantForm.isShow">
                <div class="haruyuki-line-height-special haruyuki-plr-80">
                  <span>云闪付-借记卡（≥1000）签约费率（比例）：</span>
                  <el-input-number
                    size="mini"
                    v-model="dataItem.merchantForm.debitRate"
                    :precision="4"
                    :step="0.0001"
                    :min="0"
                    :max="1"
                  ></el-input-number>
                  <span> %</span>
                </div>
                <div class="haruyuki-line-height-special haruyuki-plr-80">
                  <span>云闪付-贷记卡（≥1000）签约费率（比例）：</span>
                  <el-input-number
                    size="mini"
                    v-model="dataItem.merchantForm.creditRate"
                    :precision="4"
                    :step="0.0001"
                    :min="0"
                    :max="1"
                  ></el-input-number>
                  <span> %</span>
                </div>
                <div class="haruyuki-line-height-special haruyuki-plr-80">
                  <span>云闪付-借记卡大额封顶金额（笔）：</span>
                  <el-input-number
                    size="mini"
                    v-model="dataItem.merchantForm.debitGtMax"
                    :precision="2"
                    :step="0.1"
                    :min="0"
                  ></el-input-number>
                  <span> ¥</span>
                </div>
                <div class="haruyuki-line-height-special haruyuki-plr-80">
                  <span>云闪付-借记卡小额封顶金额（笔）：</span>
                  <el-input-number
                    size="mini"
                    v-model="dataItem.merchantForm.debitLtMax"
                    :precision="2"
                    :step="0.1"
                    :min="0"
                  ></el-input-number>
                  <span> ¥</span>
                </div>
                <div class="haruyuki-line-height-special haruyuki-plr-80">
                  <span>最低签约费率（比例）：</span>
                  <el-input-number
                    size="mini"
                    v-model="dataItem.merchantForm.aptRate"
                    :precision="4"
                    :step="0.0001"
                    :min="0"
                    :max="1"
                  ></el-input-number>
                  <span> %</span>
                </div>
                <div class="haruyuki-line-height-special haruyuki-plr-80">
                  <span>最低垫资费率（比例）：</span>
                  <el-input-number
                    size="mini"
                    v-model="dataItem.merchantForm.codeAdvanceRate"
                    :precision="4"
                    :step="0.0001"
                    :min="0"
                    :max="1"
                  ></el-input-number>
                  <span> %</span>
                </div>
                <div class="haruyuki-line-height-special haruyuki-plr-80">
                  <span>刷卡垫资费率（比例）：</span>
                  <el-input-number
                    size="mini"
                    v-model="dataItem.merchantForm.posCodeAdvanceRate"
                    :precision="4"
                    :step="0.0001"
                    :min="0"
                    :max="1"
                  ></el-input-number>
                  <span> %</span>
                </div>
                <div class="haruyuki-line-height-special haruyuki-plr-80">
                  <span>贷记卡刷卡签约费率（比例）：</span>
                  <el-input-number
                    size="mini"
                    v-model="dataItem.merchantForm.posCreditRate"
                    :precision="4"
                    :step="0.0001"
                    :min="0"
                    :max="1"
                  ></el-input-number>
                  <span> %</span>
                </div>
                <div class="haruyuki-line-height-special haruyuki-plr-80">
                  <span>借记卡刷卡签约费率（比例）：</span>
                  <el-input-number
                    size="mini"
                    v-model="dataItem.merchantForm.posDebitRate"
                    :precision="4"
                    :step="0.0001"
                    :min="0"
                    :max="1"
                  ></el-input-number>
                  <span> %</span>
                </div>
                <div class="haruyuki-line-height-special haruyuki-plr-80">
                  <span>借记卡刷卡封顶金额（笔）：</span>
                  <el-input-number
                    size="mini"
                    v-model="dataItem.merchantForm.posDebitRateMax"
                    :precision="2"
                    :step="0.1"
                    :min="0"
                  ></el-input-number>
                  <span> ¥</span>
                </div>
                <div class="haruyuki-line-height-special haruyuki-plr-80">
                  <span>刷卡挥卡签约费率（比例）：</span>
                  <el-input-number
                    size="mini"
                    v-model="dataItem.merchantForm.posWaveRate"
                    :precision="4"
                    :step="0.0001"
                    :min="0"
                    :max="1"
                  ></el-input-number>
                  <span> %</span>
                </div>
                <div class="haruyuki-line-height-special haruyuki-plr-80" v-if="dataItem.merchantForm.isShowVip == 1">
                  <span>银联费率（比例）：</span>
                  <el-input-number
                    size="mini"
                    v-model="dataItem.merchantForm.unionpayRate"
                    :precision="4"
                    :step="0.0001"
                    :min="0"
                    :max="1"
                  ></el-input-number>
                  <span> %</span>
                </div>
                <div class="haruyuki-line-height-special haruyuki-plr-80" v-if="dataItem.merchantForm.isShowVip == 1">
                  <span>尊享费率（比例）：</span>
                  <el-input-number
                    size="mini"
                    v-model="dataItem.merchantForm.vipRate"
                    :precision="4"
                    :step="0.0001"
                    :min="0"
                    :max="1"
                  ></el-input-number>
                  <span> %</span>
                </div>
              </div>
            </div>
            <!-- END 商户-(签约费率) -->

          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { servicePolicyDetail } from "@/api/rb-oem/serviceinfo/service_info";
import {
  getList,
  getDetail,
} from "@/api/rb-oem/serviceTemplate/service_template";
let intId = 2;
export default {
  props: {
    oem: Object,
    aisleCode: {
      type: [Number, String],
      default: "",
    },
    aisleCodeList: {
      type: Array,
      default: () => {
        return []
      }
    }
  },
  data() {
    return {
      policyTemplate: [], // 一键全入 模板集合
      policyTemplateCode: "", //一键全入 编号
      data: [], //通道政策 树形数据
      initData: [], //初始化数据
      initAisleCodes: [], //初始化通道编号
      aptTemplate: {
        aptRate: 0,
        aptScale: 0,
        codeAdvanceRate: 0,
      },
      thousandMin: '<1000'
    };
  },
  watch: {
    // data:{
    //   deep: true,
    //   handler(val) {
    //     if (val) {
    //       for (let i = 0; i < val.length; i++) {
    //         val[i].stateIndex = val[i].intervalList[val[i].intervalList.length-1].id
    //       }
    //     }
    //   }
    // }
  },
  created() {
    this.getTemplatePolicyList();
    this.getPolicy();
  },
  methods: {
    /* 政策通用模板查询 */
    async getTemplatePolicyList() {
      await getList("-1", "-1").then((tempRes) => {
        this.policyTemplate = tempRes.data.data.records;
      });
    },
    /* 政策查询 */
    async getPolicy() {
      let params = {
        userNo: this.oem.userNo,
        userType: this.oem.userType,
        aisleCodeList: this.aisleCodeList || [],
        // aisleCode: this.aisleCode ? this.aisleCode : "",
      }
      await servicePolicyDetail(params).then(async (res) => {
        if (res.data.code == "200") {
          let datas = res.data.data.aisleTradList;
          for (let i = 0; i < datas.length; i++) {
            this.$set(datas[i], "isShow", true);
            if (datas[i].serviceForm)
              this.$set(datas[i].serviceForm, "isShow", true);
            if (datas[i].merchantForm)
              this.$set(datas[i].merchantForm, "isShow", true);
            if (datas[i].posTrad)
              this.$set(datas[i].posTrad, "isShow", true);

            // this.$set(datas[i], "stateIndex", -1);
            await this.templatePolicy(datas[i]);
          }

          this.$nextTick(() => {
            this.data = JSON.parse(JSON.stringify(datas));
            console.log('------data--',this.data)
          });
        } else {
          this.$message({
            type: "error",
            message: res.data.message,
          });
        }
      });
    },
    /* 匹配政策通道编号 单模板查询 赋值 */
    async templatePolicy(data) {
      await getList("-1", "-1", { aisleCode: data.aisleCode }).then(
        (tempRes) => {
          this.$set(data, "template", tempRes.data.data.records);
          return data;
        }
      );
    },
    /* 通道政策模板 根据已有通道全渲染 */
    async templateAllChange(e) {
      if (e) {
        this.initAisleCodes = [];
        await getDetail(e).then((res) => {
          let templateData = res.data.data;
          for (let t = 0; t < templateData.aisleRateList.length; t++) {
            for (let d = 0; d < this.data.length; d++) {
              if (
                templateData.aisleRateList[t].aisleCode ==
                this.data[d].aisleCode
              ) {
                this.data[d].aptRate = templateData.aisleRateList[t].aptRate;
                this.data[d].aptScale = templateData.aisleRateList[t].aptScale;
                this.data[d].codeAdvanceRate =
                  templateData.aisleRateList[t].codeAdvanceRate;
                this.data[d].templatePolNo = templateData.polNo;

                this.data[d].serviceForm = {
                  isShow: true,
                  ...templateData.aisleRateList[t].serviceForm,
                };
                this.data[d].merchantForm = {
                  isShow: true,
                  ...templateData.aisleRateList[t].merchantForm,
                };
                this.data[d].posTrad = {
                  isShow: true,
                  ...templateData.aisleRateList[t].posTrad,
                };
                this.initAisleCodes.push(this.data[d].aisleCode);
              }
            }
          }
        });
      }
    },
    /* 通道政策模板 根据全渲染项全清空 */
    templateAllClear() {
      for (let i = 0; i < this.initAisleCodes.length; i++) {
        for (let d = 0; d < this.data.length; d++) {
          if (this.initAisleCodes[i] === this.data[d].aisleCode) {
            this.data[d].aptRate = 0;
            this.data[d].aptScale = 0;
            this.data[d].codeAdvanceRate = 0;
            this.data[d].polNo = "";
            // serviceForm 赋空值
            Object.keys(this.data[d].serviceForm).forEach(key=>{
              if (key !== 'isShow') {
                this.data[d].serviceForm[key] = 0;
              }
            });
            // merchantForm 赋空值
            Object.keys(this.data[d].merchantForm).forEach(key=>{
              if (key !== 'isShow') {
                this.data[d].merchantForm[key] = 0;
              }
            });
            // posTrad 赋空值
            Object.keys(this.data[d].posTrad).forEach(key=>{
              if (key !== 'isShow') {
                this.data[d].posTrad[key] = 0;
              }
            });
          }
        }
      }
    },
    /* 通道政策模板 根据单通道选择模板单渲染 */
    async templateChildChange(e, index) {
      if (e) {
        let temp = this.data[index].template.find((item) => item.polNo === e);
        await getDetail(temp.polNo, this.data[index].aisleCode).then((res) => {
          let templateData = res.data.data;
          this.data[index].aptRate = templateData.aisleRateList[0].aptRate;
          this.data[index].aptScale = templateData.aisleRateList[0].aptScale;
          this.data[index].codeAdvanceRate =
            templateData.aisleRateList[0].codeAdvanceRate;
          this.data[index].templatePolNo = templateData.polNo;
          this.data[index].serviceForm = {
            isShow: true,
            ...templateData.aisleRateList[0].serviceForm,
          };
          this.data[index].merchantForm = {
            isShow: true,
            ...templateData.aisleRateList[0].merchantForm,
          };
          this.data[index].posTrad = {
            isShow: true,
            ...templateData.aisleRateList[0].posTrad,
          };
        });
      }
    },
    templateChildClear(index) {
      this.data[index].aptRate = 0;
      this.data[index].aptScale = 0;
      this.data[index].codeAdvanceRate = 0;
      this.data[index].templatePolNo = "";
      // serviceForm 赋空值
      Object.keys(this.data[index].serviceForm).forEach(key=>{
        if (key !== 'isShow') {
          this.data[index].serviceForm[key] = 0;
        }
      });
      // merchantForm 赋空值
      Object.keys(this.data[index].merchantForm).forEach(key=>{
        if (key !== 'isShow') {
          this.data[index].merchantForm[key] = 0;
        }
      });
      // posTrad 赋空值
      Object.keys(this.data[index].posTrad).forEach(key=>{
        if (key !== 'isShow') {
          this.data[index].posTrad[key] = 0;
        }
      });
    },
    /* 全通道政策模板 一键填入 */
    submitCover() {
      if (this.aptTemplate.aptRate == 0) {
        this.$message({
          type: "warning",
          message: "请输入结算底价",
        });
      } else if (this.aptTemplate.aptScale == 0) {
        this.$message({
          type: "warning",
          message: "请输入结算比例",
        });
      } else {
        for (let d = 0; d < this.data.length; d++) {
          this.data[d].aptRate = this.aptTemplate.aptRate;
          this.data[d].aptScale = this.aptTemplate.aptScale;
          this.data[d].codeAdvanceRate = this.aptTemplate.codeAdvanceRate;
          if(this.data[d].merchantForm){
            this.data[d].merchantForm.aptRate = this.aptTemplate.aptRate;
            this.data[d].merchantForm.codeAdvanceRate = this.aptTemplate.codeAdvanceRate;
          }
         
        }
      }
    },
    changeCodeAdvanceRate(item){
      item.merchantForm.aptRate = item.aptRate;
      item.merchantForm.codeAdvanceRate = item.codeAdvanceRate;
    },
    /* 新增阶梯 */
    ladderAppend(interData, interIndex) {
      if (!interData.aptEndMoney)
        return this.$message({ type: "warning", message: "请输入范围区间" });
      let intData = JSON.parse(JSON.stringify(interData));
      intData.id = intId++;
      intData.aptStartMoney = intData.aptEndMoney;
      intData.aptEndMoney = intData.aptEndMoney + 1;
      intData.aptRate = 0; //初始化 成本费率
      intData.aptScale = 0; //初始化 结算比例
      intData.aptGrade = interIndex + 2; //阶段层级赋值
      this.data.policyTradForms.push(intData);
    },
    /* 删除阶梯 */
    ladderRemove(interIndex) {
      this.data.policyTradForms.splice(interIndex, 1);
    },
    /**
     * @func 设定默认通道
     * @desc 设定默认通道
     * @param {Number} idx - 下标
     * */
    handleSwitch(idx) {
      this.data[idx].isDefault = 1
      // this.data[idx].isDefault = this.data[idx].isDefault == 1 ? 0 : 1;
      for (let index = 0; index < this.data.length; index++) {
        if (this.data[index].aisleCode !== this.data[idx].aisleCode) {
          this.data[index].isDefault = 0;
        }
      }
    },
  },
};
</script>

<style lang="scss" scoped>
.aisle-template {
  width: 100%;
  font-weight: bold;
}

.aisle-policy-box {
  border: 1px solid #e0eafc;
  box-shadow: 0 2px 12px rgba(224, 234, 252, 0.8);
}
.aisle-policy-bg {
  background-color: #e0eafc;
  padding: 10px 0;
}

.policy-mr-6 {
  margin-right: 6px;
}
.policy-ml-3 {
  margin-left: 3px;
}

.policy-fs-14 {
  font-size: 14px;
}
</style>